package org.twdata.pipeline;

/**
 *  An executable process to transform input through an XML transformation
 *  pipeline.
 */
public interface Pipeline {

    /**
     *  Gets the name of the pipeline
     *
     *@return    The name
     */
    public String getName();


    /**
     *  Executes the pipeline with given context information
     *
     *@param  ctx                 Context information
     *@throws  PipelineException  If anything goes wrong
     */
    public void execute(PipelineContext ctx)
        throws PipelineException;

 
    /**
     *  Connects existing an existing producer and consumer to this pipeline
     *
     * @param producer The xml source
     * @param consumer The xml result
     * @param ctx The pipeline context
     */
    public void connect(XMLProducer producer, XMLConsumer consumer, PipelineContext ctx) 
        throws PipelineException ;
}

